#include "StdAfx.h"
#include "ScriptBackend.h"
#include "UIUtility.h"
#include "../Pattern/Utility.h"

// #include "Bind_BasicClasses.hpp"
// #include "Bind_SupportClasses.hpp"
// #include "Bind_RenderingWindow.hpp"
// #include "Bind_ResourceClasses.hpp"
// #include "Bind_Window.hpp"
// #include "Bind_SmallElements.hpp"
// #include "Bind_ListboxTextItem.hpp"
// #include "Bind_Combobox.hpp"
// #include "Bind_FrameWindow.hpp"

#include "LuabindScriptModule.h"

ScriptBackend::LuabindScriptModule *lsm = 0;

void OnDestory()
{
	if(lsm!=0)
	{
		delete lsm;
		lsm=0;
	}
}

void ScriptBackend::CEGUI_Module::Load( lua_State* l )
{
// 	Bind_String(l);
// 	Bind_BasicClasses(l);
// 	Bind_SupportClasses(l);
// 	Bind_RenderingWindow(l);
// 	Bind_ResourceClasses(l);
// 	Bind_Window(l);
// 	Bind_SmallElements(l);
// 	Bind_ListboxTextItem(l);
// 	Bind_Combobox(l);
// 	Bind_FrameWindow(l);

	if(lsm!=0)return;

	lsm = new LuabindScriptModule(l,&OnDestory);
	
	CEGUI::System::getSingleton().setScriptingModule(lsm);

}